import React from "react";
import useIntervalCountUp from "@/hooks/useIntervalCountUp";
import styles from "@/pages/index.less";
const CountUp: React.FC<
  {
    title?: string
    value?: number
    unit?:string
    color?:string
    size?:number
    itemStyle?:string
  } & Style
  > = (props) => {
  const { title, value, style,unit,color,itemStyle,size } = props
  // const ref = useIntervalCountUp(
  //   {
  //     end: value || 0,
  //   },
  //   5 * 1000,
  // )
  return (
      <div className='count_up_box' style={style}>
       <div className="count_up_val" style={itemStyle}>
         <span  style={{color:color?color:'#fff',fontSize:size?size:'28px'}} >{value}</span>{unit}</div>
       <div>{title}</div>
      </div>
  )
}
export  default  CountUp
